<?php /* Smarty version 2.6.2, created on 2011-09-09 08:55:40
         compiled from add_banner.tpl */ ?>
<?php echo '
<SCRIPT language=javascript type=text/javascript>	
	function adtype(){
		document.frm.specialbannerposition.disabled=true;	
		document.frm.normalbannerposition.disabled=true;
		document.frm.minibannerposition.disabled=true;
		disableAllElement(false);
		if(document.frm.ad_type[4].checked){			
			document.frm.minibannerposition.disabled=false;
			if(document.frm.minibannerposition.value < 1){
				disableAllElement(true);
			}
		}else if(document.frm.ad_type[3].checked){
			document.frm.normalbannerposition.disabled=false;
			if(document.frm.normalbannerposition.value < 1){
				disableAllElement(true);
			}				
		}else if(document.frm.ad_type[2].checked){
			document.frm.specialbannerposition.disabled=false;
			if(document.frm.specialbannerposition.value < 1){
				disableAllElement(true);
			}	
		
		}	
		SetPrice();
	}	

	function disableAllElement(isDisable){
		document.frm.ad_time.disabled = isDisable;
		document.frm.ad_time_type[0].disabled = isDisable;
		document.frm.ad_time_type[1].disabled = isDisable;
		document.frm.ad_website_url.disabled = isDisable;
		document.frm.contact_mail.disabled = isDisable;
		document.frm.ad_banner_url.disabled = isDisable;
		document.frm.description.disabled = isDisable;		
		document.frm.btnSave.disabled = isDisable;		
		document.frm.btnClose.disabled = isDisable;		
	}
	
	function validate(frm) {	
		var ad_type = false;	
		var positionEnable = 0;	
		for (counter = 0; counter < frm.ad_type.length; counter++){
			if (frm.ad_type[counter].checked)
				ad_type = true; 
		}						
		if (!ad_type){			
			alert("Please select a AD Type.");	
			return (false);			
		}

		if(document.frm.specialbannerposition.disabled == false){
			positionEnable = positionEnable + 1;
		}
		if(document.frm.normalbannerposition.disabled == false){
			positionEnable = positionEnable + 1;
		}
		if(document.frm.minibannerposition.disabled == false){
			positionEnable = positionEnable + 1;
		}
		if(positionEnable > 1){
			alert("Have a error occur. Please contact with admin");
			return false;
		}
			
		if (frm.ad_time.value.trim() == "") {			
			alert("Please Enter Ad Time.");			
			frm.ad_time.focus();			
			return (false);		
		}		
		if (isNaN(frm.ad_time.value)) {			
			alert("Please Enter Numeric Value for Ad Time.");			
			frm.ad_time.focus();			
			frm.ad_time.select();			
			return (false);		
		}		
		var ad_time_type = false;		
		for (counter = 0; counter < frm.ad_time_type.length; counter++){	
			if (frm.ad_time_type[counter].checked)
				ad_time_type = true; 	
		}			
		if (!ad_time_type){			
			alert("Please select a AD Time Type.");			
			return (false);			
		}		
		if (frm.ad_website_url.value.trim() == "") {			
			alert("Please Enter Ad Website Url.");			
			frm.ad_website_url.focus();			
			return (false);		
		}		
		if (frm.user_name.value.trim() == "") {			
			alert("Please Enter email.");			
			frm.user_name.focus();			
			return (false);		
		}		
		if (frm.ad_banner_url.value.trim() == "") {			
			alert("Please Enter Banner Url.");			
			frm.ad_banner_url.focus();			
			return (false);			
		}			
		if (frm.description.value.trim() == "") {			
			alert("Please Enter Ad Alt Text.");			
			frm.description.focus();			
			return (false);			
		}
			
		return (true);	
	}	
	function SetPrice(){
		if (isNaN(document.frm.ad_time.value)) {	
			alert("Please Enter Numeric Value for Ad Time.");	
			document.frm.ad_time.focus();	//
			document.frm.ad_time.select();
			return (false);
		}
		timesWeek = 1;
		if(document.frm.ad_time_type[0].checked){
			timesWeek = 1;
		}else if(document.frm.ad_time_type[1].checked){
			timesWeek = 3;	
		}
		adTimeValue = document.frm.ad_time.value;
		max_toprotating = document.frm.max_toprotating.value;
		max_rotating = document.frm.max_rotating.value;
		max_special = document.frm.max_special.value;
		step_special = document.frm.step_special.value;
		max_normal = document.frm.max_normal.value;
		step_normal = document.frm.step_normal.value;
		max_mini = document.frm.max_mini.value;
		step_mini = document.frm.step_mini.value;
		
		if(document.frm.ad_type[0].checked){
			javaprice=parseFloat(adTimeValue * timesWeek * max_toprotating);	
		} else if(document.frm.ad_type[1].checked){
			javaprice=parseFloat(adTimeValue *timesWeek * max_rotating);
		}else if(document.frm.ad_type[2].checked){
			javaprice=parseFloat(adTimeValue *timesWeek * (max_special - (document.frm.specialbannerposition.value-1) * step_special));
		}else if(document.frm.ad_type[3].checked){
			javaprice=parseFloat(adTimeValue * timesWeek * (max_normal - (document.frm.normalbannerposition.value-1) * step_normal));
		}else if(document.frm.ad_type[4].checked){
			javaprice=parseFloat(adTimeValue * timesWeek * (max_mini-(document.frm.minibannerposition.value-1) * step_mini));
		}
		document.frm.total_price.value=javaprice;
		document.frm.total_price1.value=javaprice;
	}
	adtype();
	SetPrice();
</SCRIPT>
'; ?>

<form name=frm method=post onsubmit="return validate(this)" >
<input type=hidden name=a value="add_banner"> 
<input type=hidden name=action value="redirectLR">



<input type=hidden name="max_toprotating" value=<?php echo $this->_tpl_vars['max_toprotating']; ?>
> 
<input type=hidden name="max_rotating" value=<?php echo $this->_tpl_vars['max_rotating']; ?>
> 
<input type=hidden name="max_special" value=<?php echo $this->_tpl_vars['max_special']; ?>
> 
<input type=hidden name="step_special" value=<?php echo $this->_tpl_vars['step_special']; ?>
> 
<input type=hidden name="max_normal" value=<?php echo $this->_tpl_vars['max_normal']; ?>
> 
<input type=hidden name="step_normal" value=<?php echo $this->_tpl_vars['step_normal']; ?>
> 
<input type=hidden name="max_mini" value=<?php echo $this->_tpl_vars['max_mini']; ?>
> 
<input type=hidden name="step_mini" value=<?php echo $this->_tpl_vars['step_mini']; ?>
>


<table width="100%" border=0 cellspacing=0 cellpadding=0>
	<tr>
		<td valign="middle" class="box1"><img src="images/t7.gif" align="left">
		<div class="side_title" align="left">Add Banner</div>
		</td>
	</tr>
	<tr>
		<td class="box2" align="center">
		<table cellspacing=0 cellpadding=2 border=0 width="90%" align="center">
			<tr>
				<td>
				<p><?php echo $this->_tpl_vars['settings']['site_name']; ?>
 currently offers 5 types of advertising:</p>
				<ul type="square" style="padding-left: 4px;">
					<li><span class="text_in_box">Top banner </span> at TOP of all our
					pages only $<?php if (showtoprotatingmin ( )): ?> <?php endif; ?> /week</li>
					<li><span class="text_in_box">Rotating banner</span> at all our
					pages only $<?php if (showrotatingmin ( )): ?> <?php endif; ?> /week</li>
					<li><span class="text_in_box">Special banner</span> at TOP of all
					our pages only start from $<?php if (showspecialmin ( )): ?> <?php endif; ?>/Week</li>
					<li><span class="text_in_box">Normal banner</span> at all our pages
					only start from $<?php if (shownormalmin ( )): ?> <?php endif; ?>/Week</li>
					<li><span class="text_in_box">Mini Banners (less than 125*125)</span>
					at all our pages only start from $5/week</li>
				</ul>

				</td>
			</tr>

			<tr>
				<td><!--start form-->
				<table cellSpacing=1 cellPadding=1 width="100%" align=center
					border="0" class="adlight">
					<tr>
						<th align=right><b>Ad Type:</b></th>
						<td class=text valign=middle><input onclick="adtype()"
							type="radio" checked="checked" value=0 name="ad_type" /> <b>TOP
						Banner(468*60)</b> <br />
						<input onclick="adtype()" type="radio" value=1 name="ad_type" />
						<b>Rotating Banner(468*60)</b> <br />
						<input onclick=adtype() type=radio value=2 name=ad_type> <b>Special
						Banner(728*90)</b> <br />
						<input onclick=adtype() type=radio value=3 name=ad_type> <b>Normal
						Banner(468*60)</B> <br />
						<input onclick="adtype()" type="radio" value="5" name="ad_type" />
						<b> Mini banner(125*125) </B></td>
					</tr>
					<tr>
						<th align=right><b>Banner Position: </b></th>
						<td style="padding-left: 7px;"><!-- php start --> 
						Special
						<select name="specialbannerposition" 
							disabled onchange="adtype()" onfocus="adtype()">
							<?php if (writeSpecialBannerPosition ( )):  endif; ?>
						</select> 
						&nbsp; 
						Normal
						<select name="normalbannerposition" disabled 
							 onblur="adtype()" onchange="adtype()" onfocus="adtype()">
							<?php if (writeNormalBannerPosition ( )):  endif; ?>
						</select> 
						&nbsp; 
						Mini
						<select name="minibannerposition" disabled
							disabled onblur="adtype()" onchange="adtype()" onfocus="adtype()">
							<?php if (writeMiniBannerPosition ( )): ?>
							<?php endif; ?>
						</select> 
						<b><font color=red>*</font></b> <!-- php end --></td>
					</tr>
					<tr>
						<th height=30 align="right" class=text><b>Period:</b></th>
						<td class=text align="left" style="padding-left: 7px;">
							<input onchange="SetPrice()" size=1 maxlength="3" value=1 name="ad_time">
							<input name="ad_time_type" type=radio onclick="SetPrice()" value=w checked="checked" title="Weeks">
							&nbsp;<b>Weeks</B>&nbsp;&nbsp;&nbsp;&nbsp;
						<input onclick="SetPrice()" type="radio" value="m" name="ad_time_type">&nbsp;<b>Months</b>
						<b><font color=red>*</font></b></td>
					</tr>
					<tr>
						<th height=30 align="right" class=text><b>Site URL :</b></th>
						<td class=text align="left" style="padding-left: 7px;">
							<input size=36 name="ad_website_url"> <b><font color=red>*</font></b></td>
					</tr>
					<tr>
						<th height=30 align="right" class=text><b>Contact Mail:</b></th>
						<td class=text align="left" style="padding-left: 7px;">
							<input size=36 name="contact_mail"> <b><font color=red>*</font></b></td>
					</tr>
					<tr>
						<th height=30 align="right" class=text><b>Banner Url :</b></th>
						<td class=text align="left" style="padding-left: 7px;">
							<input size=36 name="ad_banner_url"> <b><font color=red>*</font></b></td>
					</tr>
					<tr>
						<th height=30 align="right" valign="middle" class="text"><b>Description:&nbsp;</b></th>
						<td class="text" valign="middle" style="padding-left: 7px;">
							<input size=36 name="description"> <b><font color=red>*</font></b></td>
					</tr>
					<tr>
						<th height=30 align="right" class="text"><b>You Have to Pay :&nbsp;</b></th>
						<td class=text valign="middle" style="padding-left: 7px;">
							<input  disabled size=5 name="total_price"> &nbsp;<b>$ (USD)</b>
							<input type=hidden size=5 name="total_price1"></td>
					</tr>
					<tr>
						<th align="right" class="text"><b>Processor:</b></th>
						<td height=30 align=left style="padding-left: 7px;"><img
							src="images/LibertyReserve.gif" alt="LibertyReserve"></td>
					</tr>
					<tr>
						<td class="text" valign=top align="center" colSpan=2>
							<input class=sbmt type=submit value="Pay Now" name="btnSave"> 
							&nbsp;
							<input class="sbmt" id="btnClose" type="reset" value="  Reset  " name="reset"></td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
	</tr>
</table>


<SCRIPT>
<?php echo '
	adtype();
	SetPrice();
</SCRIPT>
'; ?>

</form>
